home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / FLEDIZ13.422 < prev    next >
Text File  |  1993-03-28  |  3KB  |  87 lines

  1. FLEDIZ13.MOD: Small update to FILEIDZ: now 2 times faster!
  2. David Morse #116 @8315
  3. 1Wednesday, 2March 324, 51993 7@ 1 96:148 7pm 2EST
  4.  
  5.  
  6. ┌────────────────────────────────────────────────────────────────────────────┐
  7. │ Mod Name:        FLEIDZ13.MOD           Mod Author: Etheral Cereal         │
  8. │ Difficulty:      █▒▒▒▒▒▒▒▒▒             Mod Updated by: David Morse        │
  9. │ WWIV Versions:   4.21a/4.22             Date:  March 24th, 1993            │
  10. │ Affected Files:  FILEIDZ.C                                                 │
  11. │ Version:         1.3 (ONLY AN UPDATE, requires 1.2 installation)           │
  12. │ Steps:           1                                                         │
  13. │ Description:     This is a small but USEFUL update to Etheral Cereal's     │
  14. │                  fantastic mod. It eliminates the need for TWO extraction  │
  15. │                  commands by comibing DESC.SDI and FILE_ID.DIZ on the      │
  16. │                  extract command line (thus making the mod about 2 times   │
  17. │                  faster! :) )                                              │
  18. └────────────────────────────────────────────────────────────────────────────┘
  19. NOTE: This is NOT a complete modification!!! This is an UPDATE, requiring
  20. that you have installed FILEIDZ.MOD already!
  21.  
  22.  
  23. << STEP 1 >>
  24. Just re-read this function back into your FILEIDZ.C.
  25.  
  26. void fileidz(uploadsrec *u,int dn)
  27. {
  28.   char *extbuf=NULL,run_me[81],s[81],s2[81],*ss;
  29.   int f,i;
  30.  
  31.   //extract FILE_ID.DIZ
  32.  
  33.   cd_to(directories[dn].path);
  34.   get_dir(s2,1);
  35.   strcat(s2,stripfn(u->filename));
  36.   cd_to(cdir);
  37.   get_arc_cmd(run_me,s2,1,"FILE_ID.DIZ DESC.SDI");   // <DM> Add DESC.SDI
  38.   cd_to(syscfg.tempdir);
  39.   do_external(run_me,0);     // this puts us back in root on return
  40.   sprintf(s,"%sFILE_ID.DIZ",syscfg.tempdir);
  41.   if (!exist(s))                                     // <DM> Major change,
  42.     sprintf(s,"%sDESC.SDI",syscfg.tempdir);          // whole chunk deleted
  43.  
  44.   if (exist(s)) {
  45.     npr("Reading in %s as extended description...",s);
  46.     ss=read_extended_description(u->filename);
  47.     if (ss) {
  48.       farfree(ss);
  49.       delete_extended_description(u->filename);
  50.     }
  51.     // read in the file id
  52.     if ((extbuf=malloca((long)MAX_LINES*1024))==NULL)
  53.       return;
  54.     f=open(s,O_RDWR | O_BINARY);
  55.     if (filelength(f)<(MAX_LINES*1024)) {
  56.       read(f,extbuf,(int) filelength(f));
  57.       (extbuf)[filelength(f)]=0;
  58.     } else {
  59.       read(f,extbuf,(int)MAX_LINES*1024);
  60.       (extbuf)[(int)MAX_LINES*1024]=0;
  61.     }
  62.     close(f);
  63.     ss=strtok(extbuf,"\n");
  64.     sprintf(u->description,"%s\0",ss);
  65.     u->mask &= ~mask_extended;
  66.     ss=strtok(NULL,"\0");
  67.     add_extended_description(u->filename,ss);
  68.     u->mask |= mask_extended;
  69.     farfree(extbuf);
  70.     npr("Done.\r\n");
  71.   }
  72.   unlink(s);
  73.   cd_to(cdir);
  74.   remove_from_temp("*.*",syscfg.tempdir,0);  // <DM> Remove comment files
  75. }
  76.  
  77. << COMPILE! >>
  78.  
  79. NOTE: Etheral Cereal disappeared or something, because his net address,
  80.       @6869, is now unrecognized by WWIVnet! But I went ahead and
  81.       posted this update anyway.
  82. 1
  83. 27─────────────═════════════ 1T2he 1T2rading 1P2ost 7[1SOUTH7] ═════════════──────────────0
  84. 31Columbia, S.C. 2- 5(803) 731-0690 2-3 USR DS 16.8 2- 1WOMRable7 2- 3ASV 2- 7Icenet Support0
  85. 47              5WWIVNet7/3AdventNet7/4ICENet7 1@28315 6-1 FidoNet 21:376/126 0
  86. 5
  87.